<script>
    var gzhverifyfile_url = "{:url('api/domain/gzhverifyfile')}";
    var addgzhdomain_url = "{:url('api/domain/addgzhDomains')}";
    var saveappid_url = "{:url('api/domain/saveAppid')}";
    var saveappsecret_url = "{:url('api/domain/saveAppSecret')}";
    var token = "{$Request.token}";
    var uid = {$user.id}
</script>
<div id="content-container" class="container">
    <div class="row">
        <div class="col-md-3">
            {include file="common/sidenav" /}
        </div>
        <div class="col-md-9">
            <div class="panel panel-default">
                <div class="panel-body">
                    <h2 class="page-header">公众号资料配置</h2>
                    <div class="form-group">
                        <div class="col-xs-12 col-sm-12">
                            <h4>1、请将备案域名泛解析到<span style="color: red">X.X.X.X</span>。<span style="color: red">泛解析</span>，前缀为*</h4>
                            <h4>2、在微信服务号，网页授权域名设置中，找到域名验证文件下载位置，复制文件名到此处<b> (注意:文件后缀都需要. 如：MP_verify_2trCUtxRxycJqfNA.txt）</b>，点击保存</h4>
                            <h4>3、在需备案域名栏你需要设置的备案域名，注意不要直接使用一级域名, 然后保存<b>(错误示例: baidu.com; 正确: www.baidu.com 或 www.aaa.bbb.com等)</b></h4>
                            <h4>4、在微信服务号，网页授权域名设置中，将第二步中输入的域名填入并保存</h4>
                        </div>
                    </div>

                    <form id="domain-form" class="form-horizontal" data-toggle="validator">
                        {:token()}
                        <input type="hidden" name="is_main_switch" id="is_main_switch" value="1" />
                        <div class="form-group">
                            <div class="col-xs-12 col-sm-12 tips">
                                <h4>请在这里配置你的<span style="color: red">公众号信息</span>。</h4>
                            </div>
                        </div>

                        <!--                   微信授权文件保存  -->
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">验证文件名:</label>
                            <div class="col-xs-12 col-sm-8">
                                <input name="verifyfile" id="verifyfile" value="{$user.verifyfile}" class="form-control" placeholder="MP_verify_2trCUtxRxycJqfNA.txt"/>
                            </div>
                            <div class="input-group-btn">
                                <button type="button" class="btn btn-warning gzhverifyfile">保存</button>
                            </div>
                        </div>

                        <!--                   设置USER表的公众号域名-->
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">需备案域名:</label>
                            <div class="col-xs-12 col-sm-8">
                                <input name="gzhdomain" id="gzhdomain" value="{$user.domain}" class="form-control" placeholder="www.baidu.com"/>
                            </div>
                            <div class="input-group-btn">
                                <button type="button" class="btn btn-warning adddomain">保存</button>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">appid:</label>
                            <div class="col-xs-12 col-sm-8">
                                <input name="gzhappid" id="gzhappid" value="{$user.wxappid}" class="form-control" placeholder="wxc39a2db5162sd6hg"/>
                            </div>
                            <div class="input-group-btn">
                                <button type="button" class="btn btn-warning saveAppId">保存</button>
                            </div>
                        </div>

                        <!--                   设置USER表的AppSecret-->
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">AppSecret:</label>
                            <div class="col-xs-12 col-sm-8">
                                <input name="gzhAppSecret" id="gzhAppSecret" value="{$user.AppSecret}" class="form-control" placeholder="c59a4540as53g7kfs68b4f60be4db"/>
                            </div>
                            <div class="input-group-btn">
                                <button type="button" class="btn btn-warning saveSecret">保存</button>
                            </div>
                        </div>

                        <!--                   设置USER表的wxmchid-->
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">wxmchid:</label>
                            <div class="col-xs-12 col-sm-8">
                                <input name="gzhmchid" id="gzhmchid" disabled="disabled" value="{$user.wxmchid}" class="form-control" placeholder="1516736941"/>
                            </div>
                            <div class="input-group-btn">
                                <button type="button" disabled="disabled" class="btn btn-warning">保存</button>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">openid:</label>
                            <div class="col-xs-12 col-sm-8">
                                <input name="openid" id="openid" disabled="disabled" value="{$user.openid}" class="form-control" placeholder=""/>
                            </div>
                            <div class="input-group-btn">
                                <button type="button" disabled="disabled" class="btn btn-warning">保存</button>
                            </div>
                        </div>


                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">设置OPENID:</label>
                            <div class="col-xs-12 col-sm-8">
                                <p>你得把上面全部信息填写完了才可以完成这一步。</p>
                                <img src="http://www.jc8mo4.cn/index/domain/getOpenid"/>
                            </div>

                        </div>
                    </form>

                </div>
            </div>
        </div>
    </div>
</div>


<style>
    .form-layer {height:100%;min-height:150px;min-width:300px;}
    .form-body {
        width:100%;
        overflow:auto;
        top:0;
        position:absolute;
        z-index:10;
        bottom:50px;
        padding:15px;
    }
    .form-layer .form-footer {
        height:50px;
        line-height:50px;
        background-color: #ecf0f1;
        width:100%;
        position:absolute;
        z-index:200;
        bottom:0;
        margin:0;
    }
    .form-footer .form-group{
        margin-left:0;
        margin-right:0;
    }
    .form-group .tips {
        margin-top:16px;
    }
</style>